package com.crazymo.multvolume;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;
import android.widget.TextView;
import com.crazymo.multvolume.m1.TestM12;
import com.crazymo.multvolume.mpt.TestMPT3202;

public class MainActivity extends Activity {
    private TextView tvLogo;
    private ImageView ivLogo;
    private final String TAG="CrazyMo";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        init();
    }

    private void init() {
        tvLogo=findViewById(R.id.tv_logo);
        String chanel=Util.getChannel(MainActivity.this);
        tvLogo.setText(chanel);
        ivLogo=findViewById(R.id.iv_logo);
        ivLogo.setBackgroundResource(R.mipmap.logo);
        doSth(chanel);
    }

    private void doSth(String chanel) {
/*        featrue.mpt.TestMPT320.hello();//在mpt 构建变体下才可以访问
        ///featrue.m1.TestM1.hello();
        Log.e(TAG,"chanel="+chanel);*/

        // 全部写在main 源集中
        if("m1".equals(chanel)){
            TestM12.hello();
            Log.e(TAG,"chanel="+chanel);
        }else if("mpt320".equals(chanel)){
            TestMPT3202.hello();
            Log.e(TAG,"chanel="+chanel);
        }
    }
}